package fun.tan90.easy.binlog.manager.dataobject.listener;

import cn.dev33.satoken.stp.StpUtil;
import com.mybatisflex.annotation.InsertListener;
import fun.tan90.easy.binlog.manager.dataobject.BinlogOutput;

import java.util.Date;

/**
 * description TODO
 * company 铁人科技
 *
 * @author 陈浩杰
 * @date 2023/9/5 17:40
 */
public class BinlogOutputOnInsertListener implements InsertListener {
    @Override
    public void onInsert(Object entity) {
        BinlogOutput binlogOutput = (BinlogOutput) entity;
        binlogOutput.setCreateId(String.valueOf(StpUtil.getLoginId()));
        binlogOutput.setCreateTime(new Date());
    }
}
